<template>
  <a-locale-provider :locale="zh_CN">
    <div>
      <nav class="bd-navbar navbar has-shadow is-spaced is-fixed-top"
           role="navigation"
           aria-label="main navigation">
        <div class="navbar-brand">

          <nuxt-link class="navbar-item" to="/">
            <img src="/headLogo.png" width="112" height="30" alt="">
          </nuxt-link>

          <a role="button"
             @click="showMenu"
             ref="burger"
             class="navbar-burger burger"
             aria-label="menu"
             aria-expanded="false"
             data-target="navbarBasic">
            <span aria-hidden="true"></span>
            <span aria-hidden="true"></span>
            <span aria-hidden="true"></span>
          </a>
        </div>

        <div ref="menu" class="navbar-menu">
          <div class="navbar-start"></div>
          <div class="navbar-end">
            <div class="navbar-item">
              <a-button type="primary"
                        shape="round"
                        size="large"
                        style="color: #3abb67;
                              background-color: transparent;
                              border-color: #3abb67;
                              text-shadow: none;"
                        ghost @click="goTo(`/transfer/`)">快传</a-button>
              <a-divider type="vertical" />
              <a-button type="danger" shape="round" size="large" ghost @click="goTo(`/subscribe/`)">订阅</a-button>
            </div>
          </div>
        </div>
      </nav>
      <div class="content">
        <nuxt />
      </div>

      <footer class="footer">
        <div class="content has-text-centered">
          <a-back-top />
          <div>
            <a @click="goTo(`/`)">{{ app.name }}</a>
            © 2019- {{  year }}
            <a-divider type="vertical" />
            黔ICP备17011880号-3
            <a-divider type="vertical" />
            <a href="https://www.upyun.com" target="_blank">
              <img src="https://upyun.sofuny.cn/bg/upyun.png" alt="又拍云logo" width="48" title="提供云存储服务" height="24">
            </a>
            <a-divider type="vertical" />
            <a @click="goTo(`/blogs/`)">博客</a>
            <a-divider type="vertical" />
            <a @click="goTo(`/letter/`)">一封信</a>
            <a-divider type="vertical" />
            <a @click="goTo(`/links/`)">友人帐</a>
            <a-divider type="vertical" />
            <a @click="goTo(`/feedback/`)">反馈</a>

          </div>
          <p style="margin-top: 20px">本站部分内容来源于网络，如果涉及侵权，请发送侵权内容到{{ app.email }}，我们会及时删除。</p>
        </div>
      </footer>
    </div>
  </a-locale-provider>
</template>
<script>
  import app from "../../app"
  import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
  export default {
    data: ()=>({
      zh_CN,
      app,
      year: new Date().getFullYear(),
    }),
    methods: {
      showMenu(e) {
        this.$refs.burger.classList.toggle('is-active');
        this.$refs.menu.classList.toggle('is-active');
      },
      goTo(path) {
        this.$router.push({ path: path })
      }
    }
  }
</script>
<style>
  html {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI',
      Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    word-spacing: 1px;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
  }

  *,
  *:before,
  *:after {
    box-sizing: border-box;
    margin: 0;
  }
  .footer{
    background-color: #fafafa;
    padding: 3rem 1.5rem 3rem;
  }
  .markdown-body ol, .markdown-body ul {
    padding-left: 0em!important;
  }
</style>
